<?php

global $prefix;

$mp3 = get_post_meta($post->ID, $prefix.'_mp3', true);
$oga = get_post_meta($post->ID, $prefix.'_oga', true);
$postid = $post->ID;

if( empty($mp3) && empty($oga) ) {
?>	

<?php if(has_post_thumbnail()) { ?>
	<section class="frame">
                	<?php 
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'blog-list' ); 
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
if ($image) : ?>
    <img src="<?php echo $image[0]; ?>" alt="" />
<?php endif; ?> 
                   
                </section>
<?php } ?>

    
<?php	
} else {
	
    ?>
    	<section class="frame">
                	<?php 
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'blog-list' ); 
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
if ($image) : ?>
    <img src="<?php echo $image[0]; ?>" alt="" />
<?php endif; ?> 
                    
                </section>
       <div class="posttype">
            
            <script type="text/javascript">
                jQuery(document).ready(function(){
                    if(jQuery().jPlayer) {
                        jQuery("#jquery_jplayer<?php echo $postid; ?>").jPlayer({
                            ready: function () {
                                jQuery(this).jPlayer("setMedia", {
                                    <?php if($mp3 != '') : ?>
                                    mp3: "<?php echo $mp3; ?>",
                                    <?php endif; ?>
                                    <?php if($oga != '') : ?>
                                    oga: "<?php echo $oga; ?>",
                                    <?php endif; ?>
                                    end: ""
                                });
                            },
                            swfPath: "<?php echo get_template_directory_uri(); ?>/jplayer",
                            cssSelectorAncestor: "#jp_interface",
                            supplied: "<?php if($oga != '') : ?>oga,<?php endif; ?><?php if($mp3 != '') : ?>mp3, <?php endif; ?> all"
                        });
                    
                    }
                });
            </script>
        
            <div id="jquery_jplayer<?php echo $postid; ?>" class="jp-jplayer jp-jplayer-audio"></div>

            <div class="jp-audio-container">
                <div class="jp-audio">
                    <div class="jp-type-single">
                        <div id="jp_interface" class="jp-interface">
                            <ul class="jp-controls">

                                <li><div class="seperator-first"></div></li>
                                <li><div class="seperator-second"></div></li>
                                <li><a href="#" class="jp-play" tabindex="1">play</a></li>
                                <li><a href="#" class="jp-pause" tabindex="1">pause</a></li>
                                <li><a href="#" class="jp-mute" tabindex="1">mute</a></li>
                                <li><a href="#" class="jp-unmute" tabindex="1">unmute</a></li>
                            </ul>

                            <div class="jp-progress-container">
                                <div class="jp-progress">
                                    <div class="jp-seek-bar">
                                        <div class="jp-play-bar"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="jp-volume-bar-container">
                                <div class="jp-volume-bar">

                                    <div class="jp-volume-bar-value"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
<div class="text">
                    <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
                    <p class="meta"><?php the_time('F j, Y') ?></p>   

                       <p><?php the_content(); ?></p>
                    </div>
                                   <div class="categoriess"><?php the_category(' '); ?></div>
	<div class="postauthors"><?php the_author_posts_link(); ?></div>
    <div class="postcomments"><?php comments_popup_link(__('No Comments', 'themeText'), __('1 Comment', 'themeText'), __( '% Comments', 'themeText') ); ?></div>         
    <?php

}

?>